home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / matrix.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-10-16  |  27.9 KB  |  897 lines

  1. VERSION 5.00
  2. Begin VB.Form MatrixForm 
  3.    Caption         =   "Matrix Object Sample"
  4.    ClientHeight    =   7065
  5.    ClientLeft      =   2370
  6.    ClientTop       =   735
  7.    ClientWidth     =   7350
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    MinButton       =   0   'False
  11.    ScaleHeight     =   7065
  12.    ScaleWidth      =   7350
  13.    Begin VB.CommandButton btExit 
  14.       Caption         =   "Exit"
  15.       Height          =   492
  16.       Left            =   120
  17.       TabIndex        =   60
  18.       Top             =   6480
  19.       Width           =   7092
  20.    End
  21.    Begin VB.Frame Frame6 
  22.       Appearance      =   0  'Flat
  23.       BackColor       =   &H8000000A&
  24.       Caption         =   "Matrix Transformations :"
  25.       ForeColor       =   &H80000008&
  26.       Height          =   4212
  27.       Left            =   3360
  28.       TabIndex        =   30
  29.       Top             =   2160
  30.       Width           =   3852
  31.       Begin VB.CommandButton btScaleAndRotate 
  32.          Caption         =   "TranslateScaleAndRotate"
  33.          Height          =   372
  34.          Left            =   120
  35.          TabIndex        =   58
  36.          ToolTipText     =   "Use Rotate, Scale, Angle, Vertex "
  37.          Top             =   3600
  38.          Width           =   3612
  39.       End
  40.       Begin VB.CommandButton Translate 
  41.          Caption         =   "Translate"
  42.          Height          =   372
  43.          Index           =   5
  44.          Left            =   1320
  45.          TabIndex        =   57
  46.          ToolTipText     =   "Use Vertex, Bool flag"
  47.          Top             =   3000
  48.          Width           =   1092
  49.       End
  50.       Begin VB.CommandButton Scale 
  51.          Caption         =   "Scale"
  52.          Height          =   372
  53.          Index           =   4
  54.          Left            =   2520
  55.          TabIndex        =   56
  56.          ToolTipText     =   "Use Scale, Vertex, Bool flag"
  57.          Top             =   3000
  58.          Width           =   1212
  59.       End
  60.       Begin VB.CommandButton Rotate 
  61.          Caption         =   "Rotate"
  62.          Height          =   372
  63.          Index           =   3
  64.          Left            =   120
  65.          TabIndex        =   55
  66.          ToolTipText     =   "Use Rotate, Angle, Vertex, Bool Flag"
  67.          Top             =   3000
  68.          Width           =   1092
  69.       End
  70.       Begin VB.TextBox valFlag 
  71.          Height          =   288
  72.          Left            =   1680
  73.          TabIndex        =   49
  74.          Top             =   2280
  75.          Width           =   612
  76.       End
  77.       Begin VB.TextBox valAngle 
  78.          Height          =   288
  79.          Left            =   1680
  80.          TabIndex        =   48
  81.          Top             =   1920
  82.          Width           =   612
  83.       End
  84.       Begin VB.TextBox valRotZ 
  85.          Height          =   288
  86.          Left            =   3120
  87.          TabIndex        =   43
  88.          Top             =   1440
  89.          Width           =   612
  90.       End
  91.       Begin VB.TextBox valRotY 
  92.          Height          =   288
  93.          Left            =   2400
  94.          TabIndex        =   42
  95.          Top             =   1440
  96.          Width           =   612
  97.       End
  98.       Begin VB.TextBox valRotX 
  99.          Height          =   288
  100.          Left            =   1680
  101.          TabIndex        =   41
  102.          Top             =   1440
  103.          Width           =   612
  104.       End
  105.       Begin VB.TextBox valScaleZ 
  106.          Height          =   288
  107.          Left            =   3120
  108.          TabIndex        =   40
  109.          Top             =   1080
  110.          Width           =   612
  111.       End
  112.       Begin VB.TextBox valScaleY 
  113.          Height          =   288
  114.          Left            =   2400
  115.          TabIndex        =   39
  116.          Top             =   1080
  117.          Width           =   612
  118.       End
  119.       Begin VB.TextBox valScaleX 
  120.          Height          =   288
  121.          Left            =   1680
  122.          TabIndex        =   38
  123.          Top             =   1080
  124.          Width           =   612
  125.       End
  126.       Begin VB.TextBox valVertexZ 
  127.          Height          =   288
  128.          Left            =   3120
  129.          TabIndex        =   33
  130.          Top             =   720
  131.          Width           =   612
  132.       End
  133.       Begin VB.TextBox valVertexY 
  134.          Height          =   288
  135.          Left            =   2400
  136.          TabIndex        =   32
  137.          Top             =   720
  138.          Width           =   612
  139.       End
  140.       Begin VB.TextBox valVertexX 
  141.          Height          =   288
  142.          Left            =   1680
  143.          TabIndex        =   31
  144.          Top             =   720
  145.          Width           =   612
  146.       End
  147.       Begin VB.Line Line6 
  148.          BorderColor     =   &H80000006&
  149.          X1              =   0
  150.          X2              =   3960
  151.          Y1              =   2760
  152.          Y2              =   2760
  153.       End
  154.       Begin VB.Label Label6 
  155.          Caption         =   "Parameters :"
  156.          Height          =   252
  157.          Left            =   120
  158.          TabIndex        =   51
  159.          Top             =   240
  160.          Width           =   1332
  161.       End
  162.       Begin VB.Label Label5 
  163.          Caption         =   "Bool flag :"
  164.          Height          =   252
  165.          Left            =   120
  166.          TabIndex        =   50
  167.          Top             =   2280
  168.          Width           =   1332
  169.       End
  170.       Begin VB.Label Label4 
  171.          Caption         =   "Angle :"
  172.          Height          =   252
  173.          Left            =   120
  174.          TabIndex        =   47
  175.          Top             =   1920
  176.          Width           =   1332
  177.       End
  178.       Begin VB.Line Line4 
  179.          BorderColor     =   &H80000006&
  180.          X1              =   1560
  181.          X2              =   3840
  182.          Y1              =   1800
  183.          Y2              =   1800
  184.       End
  185.       Begin VB.Label Label3 
  186.          Caption         =   "Rotate :"
  187.          Height          =   252
  188.          Left            =   120
  189.          TabIndex        =   46
  190.          Top             =   1440
  191.          Width           =   1332
  192.       End
  193.       Begin VB.Label Label2 
  194.          Caption         =   "Scale :"
  195.          Height          =   252
  196.          Index           =   1
  197.          Left            =   120
  198.          TabIndex        =   45
  199.          Top             =   1080
  200.          Width           =   1332
  201.       End
  202.       Begin VB.Label Label2 
  203.          Caption         =   "Vertex :"
  204.          Height          =   252
  205.          Index           =   0
  206.          Left            =   120
  207.          TabIndex        =   44
  208.          Top             =   720
  209.          Width           =   1332
  210.       End
  211.       Begin VB.Line Line3 
  212.          BorderColor     =   &H80000006&
  213.          X1              =   1560
  214.          X2              =   1560
  215.          Y1              =   240
  216.          Y2              =   2760
  217.       End
  218.       Begin VB.Line Line2 
  219.          BorderColor     =   &H80000006&
  220.          X1              =   0
  221.          X2              =   3840
  222.          Y1              =   600
  223.          Y2              =   600
  224.       End
  225.       Begin VB.Label Label1 
  226.          Alignment       =   2  'Center
  227.          Caption         =   "Z"
  228.          Height          =   252
  229.          Index           =   2
  230.          Left            =   3120
  231.          TabIndex        =   36
  232.          Top             =   240
  233.          Width           =   612
  234.       End
  235.       Begin VB.Label Label1 
  236.          Alignment       =   2  'Center
  237.          Caption         =   "Y"
  238.          Height          =   252
  239.          Index           =   1
  240.          Left            =   2400
  241.          TabIndex        =   35
  242.          Top             =   240
  243.          Width           =   612
  244.       End
  245.       Begin VB.Label Label1 
  246.          Alignment       =   2  'Center
  247.          Caption         =   "X"
  248.          Height          =   252
  249.          Index           =   0
  250.          Left            =   1680
  251.          TabIndex        =   34
  252.          Top             =   240
  253.          Width           =   612
  254.       End
  255.    End
  256.    Begin VB.Frame Frame5 
  257.       Appearance      =   0  'Flat
  258.       BackColor       =   &H8000000A&
  259.       Caption         =   "Matrix's set"
  260.       ForeColor       =   &H80000008&
  261.       Height          =   4212
  262.       Left            =   120
  263.       TabIndex        =   11
  264.       Top             =   2160
  265.       Width           =   3012
  266.       Begin VB.CommandButton Transpose 
  267.          Caption         =   "Transpose"
  268.          Height          =   372
  269.          Index           =   0
  270.          Left            =   120
  271.          TabIndex        =   54
  272.          Top             =   3720
  273.          Width           =   2772
  274.       End
  275.       Begin VB.CommandButton Invert 
  276.          Caption         =   "Invert"
  277.          Height          =   372
  278.          Index           =   0
  279.          Left            =   1560
  280.          TabIndex        =   53
  281.          Top             =   3240
  282.          Width           =   1332
  283.       End
  284.       Begin VB.CommandButton Identity 
  285.          Caption         =   "Identity"
  286.          Height          =   372
  287.          Index           =   1
  288.          Left            =   120
  289.          TabIndex        =   52
  290.          Top             =   3240
  291.          Width           =   1332
  292.       End
  293.       Begin VB.ComboBox cbMatrix 
  294.          Height          =   288
  295.          Left            =   120
  296.          TabIndex        =   37
  297.          Top             =   2280
  298.          Width           =   2772
  299.       End
  300.       Begin VB.CommandButton btSet 
  301.          Caption         =   "Set"
  302.          Height          =   372
  303.          Left            =   120
  304.          TabIndex        =   29
  305.          Top             =   2760
  306.          Width           =   1332
  307.       End
  308.       Begin VB.CommandButton btGet 
  309.          Caption         =   "Get"
  310.          Height          =   372
  311.          Left            =   1560
  312.          TabIndex        =   28
  313.          Top             =   2760
  314.          Width           =   1332
  315.       End
  316.       Begin VB.TextBox matrix_33 
  317.          Height          =   288
  318.          Left            =   2280
  319.          TabIndex        =   27
  320.          Top             =   1800
  321.          Width           =   612
  322.       End
  323.       Begin VB.TextBox matrix_32 
  324.          Height          =   288
  325.          Left            =   1560
  326.          TabIndex        =   26
  327.          Top             =   1800
  328.          Width           =   612
  329.       End
  330.       Begin VB.TextBox matrix_31 
  331.          Height          =   288
  332.          Left            =   840
  333.          TabIndex        =   25
  334.          Top             =   1800
  335.          Width           =   612
  336.       End
  337.       Begin VB.TextBox matrix_30 
  338.          Height          =   288
  339.          Left            =   120
  340.          TabIndex        =   24
  341.          Top             =   1800
  342.          Width           =   612
  343.       End
  344.       Begin VB.TextBox matrix_23 
  345.          Height          =   288
  346.          Left            =   2280
  347.          TabIndex        =   23
  348.          Top             =   1440
  349.          Width           =   612
  350.       End
  351.       Begin VB.TextBox matrix_22 
  352.          Height          =   288
  353.          Left            =   1560
  354.          TabIndex        =   22
  355.          Top             =   1440
  356.          Width           =   612
  357.       End
  358.       Begin VB.TextBox matrix_21 
  359.          Height          =   288
  360.          Left            =   840
  361.          TabIndex        =   21
  362.          Top             =   1440
  363.          Width           =   612
  364.       End
  365.       Begin VB.TextBox matrix_20 
  366.          Height          =   288
  367.          Left            =   120
  368.          TabIndex        =   20
  369.          Top             =   1440
  370.          Width           =   612
  371.       End
  372.       Begin VB.TextBox matrix_13 
  373.          Height          =   288
  374.          Left            =   2280
  375.          TabIndex        =   19
  376.          Top             =   1080
  377.          Width           =   612
  378.       End
  379.       Begin VB.TextBox matrix_12 
  380.          Height          =   288
  381.          Left            =   1560
  382.          TabIndex        =   18
  383.          Top             =   1080
  384.          Width           =   612
  385.       End
  386.       Begin VB.TextBox matrix_11 
  387.          Height          =   288
  388.          Left            =   840
  389.          TabIndex        =   17
  390.          Top             =   1080
  391.          Width           =   612
  392.       End
  393.       Begin VB.TextBox matrix_10 
  394.          Height          =   288
  395.          Left            =   120
  396.          TabIndex        =   16
  397.          Top             =   1080
  398.          Width           =   612
  399.       End
  400.       Begin VB.TextBox matrix_03 
  401.          Height          =   288
  402.          Left            =   2280
  403.          TabIndex        =   15
  404.          Top             =   720
  405.          Width           =   612
  406.       End
  407.       Begin VB.TextBox matrix_02 
  408.          Height          =   288
  409.          Left            =   1560
  410.          TabIndex        =   14
  411.          Top             =   720
  412.          Width           =   612
  413.       End
  414.       Begin VB.TextBox matrix_01 
  415.          Height          =   288
  416.          Left            =   840
  417.          TabIndex        =   13
  418.          Top             =   720
  419.          Width           =   612
  420.       End
  421.       Begin VB.TextBox matrix_00 
  422.          Height          =   288
  423.          Left            =   120
  424.          TabIndex        =   12
  425.          Top             =   720
  426.          Width           =   612
  427.       End
  428.       Begin VB.Line Line8 
  429.          BorderColor     =   &H80000006&
  430.          X1              =   3000
  431.          X2              =   0
  432.          Y1              =   600
  433.          Y2              =   600
  434.       End
  435.       Begin VB.Label Label7 
  436.          Alignment       =   2  'Center
  437.          Caption         =   "Contents :"
  438.          Height          =   252
  439.          Left            =   840
  440.          TabIndex        =   59
  441.          Top             =   240
  442.          Width           =   1332
  443.       End
  444.       Begin VB.Line Line1 
  445.          BorderColor     =   &H80000006&
  446.          X1              =   0
  447.          X2              =   3000
  448.          Y1              =   2160
  449.          Y2              =   2160
  450.       End
  451.    End
  452.    Begin VB.Frame Frame3 
  453.       Appearance      =   0  'Flat
  454.       BackColor       =   &H8000000A&
  455.       Caption         =   "Create :"
  456.       ClipControls    =   0   'False
  457.       ForeColor       =   &H80000008&
  458.       Height          =   1932
  459.       Left            =   120
  460.       TabIndex        =   0
  461.       Top             =   120
  462.       Width           =   7092
  463.       Begin VB.Frame Frame2 
  464.          Appearance      =   0  'Flat
  465.          BackColor       =   &H8000000A&
  466.          Caption         =   "Command :"
  467.          ForeColor       =   &H80000008&
  468.          Height          =   1332
  469.          Left            =   3240
  470.          TabIndex        =   3
  471.          Top             =   360
  472.          Width           =   3732
  473.          Begin VB.CommandButton btDuplicate 
  474.             Caption         =   "Duplicate"
  475.             Enabled         =   0   'False
  476.             Height          =   372
  477.             Left            =   1320
  478.             TabIndex        =   10
  479.             Top             =   480
  480.             Width           =   1092
  481.          End
  482.          Begin VB.CommandButton btDelete 
  483.             Caption         =   "Delete"
  484.             Enabled         =   0   'False
  485.             Height          =   372
  486.             Left            =   2520
  487.             TabIndex        =   9
  488.             Top             =   480
  489.             Width           =   1092
  490.          End
  491.          Begin VB.CommandButton btCreate 
  492.             Caption         =   "Create"
  493.             Height          =   372
  494.             Left            =   120
  495.             TabIndex        =   8
  496.             Top             =   480
  497.             Width           =   1092
  498.          End
  499.       End
  500.       Begin VB.Frame Frame1 
  501.          Appearance      =   0  'Flat
  502.          BackColor       =   &H8000000A&
  503.          Caption         =   "Server mode :"
  504.          ForeColor       =   &H80000008&
  505.          Height          =   1332
  506.          Left            =   1560
  507.          TabIndex        =   2
  508.          Top             =   360
  509.          Width           =   1452
  510.          Begin VB.OptionButton optLocal 
  511.             Caption         =   "Local"
  512.             Height          =   252
  513.             Left            =   120
  514.             TabIndex        =   7
  515.             Top             =   840
  516.             Width           =   852
  517.          End
  518.          Begin VB.OptionButton optInproc 
  519.             Caption         =   "In-proc"
  520.             Height          =   252
  521.             Left            =   120
  522.             TabIndex        =   6
  523.             Top             =   360
  524.             Value           =   -1  'True
  525.             Width           =   852
  526.          End
  527.       End
  528.       Begin VB.Frame Frame4 
  529.          Appearance      =   0  'Flat
  530.          BackColor       =   &H8000000A&
  531.          Caption         =   "Object :"
  532.          ClipControls    =   0   'False
  533.          ForeColor       =   &H80000008&
  534.          Height          =   1332
  535.          Left            =   120
  536.          TabIndex        =   1
  537.          Top             =   360
  538.          Width           =   1335
  539.          Begin VB.OptionButton optVertex 
  540.             Caption         =   "Vertex"
  541.             Height          =   252
  542.             Left            =   120
  543.             TabIndex        =   5
  544.             Top             =   840
  545.             Width           =   975
  546.          End
  547.          Begin VB.OptionButton optMatrix 
  548.             Caption         =   "Matrix"
  549.             Height          =   252
  550.             Left            =   120
  551.             TabIndex        =   4
  552.             Top             =   360
  553.             Value           =   -1  'True
  554.             Width           =   732
  555.          End
  556.       End
  557.    End
  558.    Begin VB.Line Line7 
  559.       X1              =   120
  560.       X2              =   3120
  561.       Y1              =   2760
  562.       Y2              =   2760
  563.    End
  564.    Begin VB.Line Line5 
  565.       X1              =   3360
  566.       X2              =   7200
  567.       Y1              =   2520
  568.       Y2              =   2520
  569.    End
  570. Attribute VB_Name = "MatrixForm"
  571. Attribute VB_GlobalNameSpace = False
  572. Attribute VB_Creatable = False
  573. Attribute VB_PredeclaredId = True
  574. Attribute VB_Exposed = False
  575. '******************************************************************'
  576. '*                                                                *'
  577. '*                      TurboCAD for Windows                      *'
  578. '*                   Copyright (c) 1993 - 2001                    *'
  579. '*             International Microcomputer Software, Inc.         *'
  580. '*                            (IMSI)                              *'
  581. '*                      All rights reserved.                      *'
  582. '*                                                                *'
  583. '******************************************************************'
  584. Dim bObject As Boolean
  585. Dim bMode As Boolean
  586. Dim objVertex As Object
  587. Dim objarrMatrix(99) As Object
  588. Dim indMatrix As Long
  589. Dim varMatrix As Variant
  590. Dim dblMatrix(3, 3) As Double
  591. Private Sub btCreate_Click()
  592.     Dim strMatrix As String
  593.     On Error GoTo ErrorHandler
  594.     If (bObject = True) Then
  595.         indMatrix = indMatrix + 1
  596.         If (bMode = True) Then
  597.             strMatrix = "In-proc matrix"
  598.             Set objarrMatrix(indMatrix) = CreateObject("IMSIGX.Matrix.4")
  599.         Else
  600.             strMatrix = "Local matrix"
  601.             Set objarrMatrix(indMatrix) = CreateObject("TurboCad.Matrix.4")
  602.         End If
  603.         strMatrix = strMatrix + Str(indMatrix)
  604.         cbMatrix.AddItem strMatrix
  605.         cbMatrix.Text = cbMatrix.List(indMatrix)
  606.         btDuplicate.Enabled = True
  607.     Else
  608.         If (bMode = True) Then
  609.             Set objVertex = CreateObject("IMSIGX.Vertex.4")
  610.         Else
  611.             Set objVertex = CreateObject("TurboCad.Vertex.4")
  612.         End If
  613.         btCreate.Enabled = False
  614.         btDuplicate.Enabled = False
  615.         btDelete.Enabled = True
  616.     End If
  617.     Exit Sub
  618. ErrorHandler:
  619.     MsgBox Error(Err.Number)
  620. End Sub
  621. Private Sub btDelete_Click()
  622.     On Error GoTo ErrorHandler
  623.     If (bObject = False) Then
  624.         objVertex.Delete
  625.         btDelete.Enabled = False
  626.         btCreate.Enabled = True
  627.     Else
  628.         If (ind < atrix >= 0) Then
  629.             objarrMatrix(indMatrix).Delete
  630.             If (indMatrix > cbMatrix.ListCount) Then
  631.                 indMatrix = indMatrix - 1
  632.             End If
  633.         End If
  634.     End If
  635.     Exit Sub
  636. ErrorHandler:
  637.     MsgBox Error(Err.Number)
  638. End Sub
  639. Private Sub btDuplicate_Click()
  640.     Dim indNewMatrix As Long
  641.     Dim strMatrix As String
  642.     On Error GoTo ErrorHandler
  643.     If (bObject = True) Then
  644.         indNewMatrix = cbMatrix.ListCount
  645.         If (indMatrix > 99) Then
  646.             Error 9
  647.         Else
  648.             Set objarrMatrix(indNewMatrix) = objarrMatrix(indMatrix).Duplicate
  649.             strMatrix = cbMatrix.Text + Str(indNewMatrix)
  650.             cbMatrix.AddItem strMatrix
  651.             cbMatrix.Text = cbMatrix.List(indNewMatrix)
  652.         End If
  653.     Else
  654.         MsgBox "Don't duplicate Vertex !"
  655.     End If
  656.     Exit Sub
  657. ErrorHandler:
  658.     MsgBox Error(Err.Number)
  659. End Sub
  660. Private Sub btExit_Click()
  661.     On Error Resume Next
  662.     objVertex.Delete
  663.     End
  664. End Sub
  665. Private Sub btGet_Click()
  666.     Dim i As Integer
  667.     Dim j As Integer
  668.     On Error GoTo ErrorHandler
  669.     If (indMatrix < 0) Then Error 424
  670.     For i = 0 To 3 Step 1
  671.         For j = 0 To 3 Step 1
  672.             dblMatrix(i, j) = 0
  673.         Next j
  674.     Next i
  675.     varMatrix = dblMatrix
  676.     objarrMatrix(indMatrix).GetArray varMatrix
  677.     matrix_00.Text = varMatrix(0, 0)
  678.     matrix_01.Text = varMatrix(0, 1)
  679.     matrix_02.Text = varMatrix(0, 2)
  680.     matrix_03.Text = varMatrix(0, 3)
  681.     matrix_10.Text = varMatrix(1, 0)
  682.     matrix_11.Text = varMatrix(1, 1)
  683.     matrix_12.Text = varMatrix(1, 2)
  684.     matrix_13.Text = varMatrix(1, 3)
  685.     matrix_20.Text = varMatrix(2, 0)
  686.     matrix_21.Text = varMatrix(2, 1)
  687.     matrix_22.Text = varMatrix(2, 2)
  688.     matrix_23.Text = varMatrix(2, 3)
  689.     matrix_30.Text = varMatrix(3, 0)
  690.     matrix_31.Text = varMatrix(3, 1)
  691.     matrix_32.Text = varMatrix(3, 2)
  692.     matrix_33.Text = varMatrix(3, 3)
  693.     Exit Sub
  694. ErrorHandler:
  695.     MsgBox Error(Err.Number)
  696. End Sub
  697. Private Sub btScaleAndRotate_Click()
  698.     Dim X As Double
  699.     Dim Y As Double
  700.     Dim Z As Double
  701.     Dim XScale As Double
  702.     Dim YScale As Double
  703.     Dim ZScale As Double
  704.     Dim Angle As Double
  705.     Dim varVertex As Variant
  706.     On Error GoTo ErrorHandler
  707.     If (indMatrix < 0) Then Error 424
  708.     X = Val(valVertexX.Text)
  709.     Y = Val(valVertexY.Text)
  710.     Z = Val(valVertexZ.Text)
  711.     objVertex.X = X
  712.     objVertex.Y = Y
  713.     objVertex.Z = Z
  714.     Set varVertex = objVertex
  715.     XScale = Val(valScaleX.Text)
  716.     YScale = Val(valScaleY.Text)
  717.     ZScale = Val(valScaleZ.Text)
  718.     X = Val(valRotX.Text)
  719.     Y = Val(valRotY.Text)
  720.     Z = Val(valRotZ.Text)
  721.     Angle = Val(valAngle.Text)
  722.     objarrMatrix(indMatrix).TranslateScaleAndRotateZ X, Y, Z, XScale, YScale, ZScale, Angle, varVertex
  723.     Exit Sub
  724. ErrorHandler:
  725.     MsgBox Error(Err.Number)
  726. End Sub
  727. Private Sub btSet_Click()
  728.     On Error GoTo ErrorHandler
  729.     If (indMatrix < 0) Then Error 424
  730.     dblMatrix(0, 0) = Val(matrix_00.Text)
  731.     dblMatrix(0, 1) = Val(matrix_01.Text)
  732.     dblMatrix(0, 2) = Val(matrix_02.Text)
  733.     dblMatrix(0, 3) = Val(matrix_03.Text)
  734.     dblMatrix(1, 0) = Val(matrix_10.Text)
  735.     dblMatrix(1, 1) = Val(matrix_11.Text)
  736.     dblMatrix(1, 2) = Val(matrix_12.Text)
  737.     dblMatrix(1, 3) = Val(matrix_13.Text)
  738.     dblMatrix(2, 0) = Val(matrix_20.Text)
  739.     dblMatrix(2, 1) = Val(matrix_21.Text)
  740.     dblMatrix(2, 2) = Val(matrix_22.Text)
  741.     dblMatrix(2, 3) = Val(matrix_23.Text)
  742.     dblMatrix(3, 0) = Val(matrix_30.Text)
  743.     dblMatrix(3, 1) = Val(matrix_31.Text)
  744.     dblMatrix(3, 2) = Val(matrix_32.Text)
  745.     dblMatrix(3, 3) = Val(matrix_33.Text)
  746.     varMatrix = dblMatrix
  747.     objarrMatrix(indMatrix).SetArray varMatrix
  748.     Exit Sub
  749. ErrorHandler:
  750.     MsgBox Error(Err.Number)
  751. End Sub
  752. Private Sub cbMatrix_Click()
  753.     indMatrix = cbMatrix.ListIndex
  754. End Sub
  755. Private Sub Form_Load()
  756.     bObject = True
  757.     bMode = True
  758.     indMatrix = -1
  759. End Sub
  760. Private Sub Identity_Click(Index As Integer)
  761.     On Error GoTo ErrorHandler
  762.     If (indMatrix < 0) Then Error 424
  763.     objarrMatrix(indMatrix).Identity
  764.     Exit Sub
  765. ErrorHandler:
  766.     MsgBox Error(Err.Number)
  767. End Sub
  768. Private Sub Invert_Click(Index As Integer)
  769.     On Error GoTo ErrorHandler
  770.     If (indMatrix < 0) Then Error 424
  771.     objarrMatrix(indMatrix).Invert
  772.     Exit Sub
  773. ErrorHandler:
  774.     MsgBox Error(Err.Number)
  775. End Sub
  776. Private Sub optInproc_Click()
  777.     bMode = True 'In-proc server
  778.     optLocal.Value = False
  779. End Sub
  780. Private Sub optLocal_Click()
  781.     bMode = False 'Local server
  782.     optInproc.Value = False
  783. End Sub
  784. Private Sub optMatrix_Click()
  785.     bObject = True ' Create matrix object
  786.     optVertex.Value = False
  787.     btCreate.Enabled = True
  788.     btDelete.Enabled = False
  789.     If (indMatrix >= 0) Then
  790.         btDuplicate.Enabled = True
  791.     Else
  792.         btDuplicate.Enabled = False
  793.     End If
  794. End Sub
  795. Private Sub optVertex_Click()
  796.     Dim hVertex As Long
  797.     bObject = False 'Create vertex object
  798.     optMatrix.Value = False
  799.     btDuplicate.Enabled = False
  800.     On Error GoTo ErrorHandler
  801.     hVertex = objVertex.GetHandle()
  802. VertexExist:
  803.     btCreate.Enabled = False
  804.     btDelete.Enabled = True
  805.     Exit Sub
  806. ErrorHandler:
  807.     If (Err.Number <> 438) Then
  808.         btDelete.Enabled = False
  809.         btCreate.Enabled = True
  810.     Else
  811.         GoTo VertexExist
  812.     End If
  813. End Sub
  814. Private Sub Rotate_Click(Index As Integer)
  815.     Dim X As Double
  816.     Dim Y As Double
  817.     Dim Z As Double
  818.     Dim Angle As Double
  819.     Dim varConcat As Variant
  820.     Dim varVertex As Variant
  821.     Dim bConcat As Boolean
  822.     On Error GoTo ErrorHandler
  823.     If (indMatrix < 0) Then Error 424
  824.     X = Val(valVertexX.Text)
  825.     Y = Val(valVertexY.Text)
  826.     Z = Val(valVertexZ.Text)
  827.     objVertex.X = X
  828.     objVertex.Y = Y
  829.     objVertex.Z = Z
  830.     Set varVertex = objVertex
  831.     X = Val(valRotX.Text)
  832.     Y = Val(valRotY.Text)
  833.     Z = Val(valRotZ.Text)
  834.     Angle = Val(valAngle.Text)
  835.     bConcat = Val(valFlag)
  836.     varConcat = bConcat
  837.     objarrMatrix(indMatrix).Rotate X, Y, Z, Angle, varVertex, varConcat
  838.     Exit Sub
  839. ErrorHandler:
  840.     MsgBox Error(Err.Number)
  841. End Sub
  842. Private Sub Scale_Click(Index As Integer)
  843.     Dim hResult As Long
  844.     Dim X As Double
  845.     Dim Y As Double
  846.     Dim Z As Double
  847.        
  848.     Dim varConcat As Variant
  849.     Dim varVertex As Variant
  850.     Dim bConcat As Boolean
  851.     On Error GoTo ErrorHandler
  852.     If (indMatrix < 0) Then Error 424
  853.     X = Val(valVertexX.Text)
  854.     Y = Val(valVertexY.Text)
  855.     Z = Val(valVertexZ.Text)
  856.     objVertex.X = X
  857.     objVertex.Y = Y
  858.     objVertex.Z = Z
  859.     Set varVertex = objVertex
  860.     X = Val(valScaleX.Text)
  861.     Y = Val(valScaleY.Text)
  862.     Z = Val(valScaleZ.Text)
  863.     bConcat = Val(valFlag)
  864.     varConcat = bConcat
  865.     hResult = objarrMatrix(indMatrix).Scale(X, Y, Z, varVertex, varConcat)
  866.     Exit Sub
  867. ErrorHandler:
  868.     MsgBox Error(Err.Number)
  869. End Sub
  870. Private Sub Translate_Click(Index As Integer)
  871.     Dim X As Double
  872.     Dim Y As Double
  873.     Dim Z As Double
  874.     Dim varConcat As Variant
  875.     Dim varVetrex As Variant
  876.     Dim bConcat As Boolean
  877.     On Error GoTo ErrorHandler
  878.     If (indMatrix < 0) Then Error 424
  879.     X = Val(valVertexX.Text)
  880.     Y = Val(valVertexY.Text)
  881.     Z = Val(valVertexZ.Text)
  882.     bConcat = Val(valFlag)
  883.     varConcat = bConcat
  884.     objarrMatrix(indMatrix).Translate X, Y, Z, varConcat
  885.     Exit Sub
  886. ErrorHandler:
  887.     MsgBox Error(Err.Number)
  888. End Sub
  889. Private Sub Transpose_Click(Index As Integer)
  890.     On Error GoTo ErrorHandler
  891.     If (indMatrix < 0) Then Error 424
  892.     objarrMatrix(indMatrix).Transpose
  893.     Exit Sub
  894. ErrorHandler:
  895.     MsgBox Error(Err.Number)
  896. End Sub
  897.